package com.jd.jobkeeper.server.web.controller;

import com.jd.jobkeeper.server.data.entity.Namespace;
import com.jd.jobkeeper.server.service.NamespaceService;
import com.jd.jobkeeper.server.web.vo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/namespace")
public class NamespaceController {

    final NamespaceService namespaceService;

    public NamespaceController(NamespaceService namespaceService) {
        this.namespaceService = namespaceService;
    }

    @PostMapping
    public Result add(Namespace namespace){
        this.namespaceService.add(namespace);
        return Result.success();
    }
}
